package org.imast.actions;

import java.util.ArrayList;
import java.util.List;

import org.imast.models.ModelVehicle;
import org.imast.services.ServiceVehicle;

import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;

public class ActionVehicles extends ActionSupport implements ModelDriven<ModelVehicle>{
	
	private ModelVehicle vehicle = new ModelVehicle();
	private List<ModelVehicle> listVehicle = new ArrayList<ModelVehicle>();
	private ServiceVehicle serviceVehicle = new ServiceVehicle();
	
	public String getAll(){
		
		listVehicle = serviceVehicle.getAll();
		
		return SUCCESS;
		
	}

	public ModelVehicle getVehicle() {
		return vehicle;
	}

	public void setVehicle(ModelVehicle vehicle) {
		this.vehicle = vehicle;
	}

	public List<ModelVehicle> getListVehicle() {
		return listVehicle;
	}

	public void setListVehicle(List<ModelVehicle> listVehicle) {
		this.listVehicle = listVehicle;
	}

	@Override
	public ModelVehicle getModel() {
		// TODO Auto-generated method stub
		return vehicle;
	}

}
